/*
 * main.cc
 *
 *  Created on: Nov 18, 2010
 *      Author: fify
 */

#include <vector>
#include <stdio.h>
#include <string>

using namespace std;

char buf1[20];
char buf2[20];

int main()
{
	while(scanf("%s%s", buf1, buf2) != EOF)
	{
		int res = 0;
		for(int i = 0;buf1[i];i++)
		{
			for(int j = 0;buf2[j];j++)
			{
				res += (buf1[i] - '0') * (buf2[j] - '0');
			}
		}
		printf("%d\n", res);
	}
}
